<template>
  <el-table :data="tableData" style="width: 100%,height: 100%" max-height="600px">
    <el-table-column prop="facilitytype" label="设备类型" width="170"> </el-table-column>
    <el-table-column prop="facilityname" label="设备名称" width="150"> </el-table-column>
    <el-table-column prop="attname" label="属性名称" width="150"> </el-table-column>
    <el-table-column prop="attvalue" label="属性值" width="150"> </el-table-column>
    <el-table-column prop="atttime" label="发生时间" width="150"> </el-table-column>
    <el-table-column fixed="right" label="操作" width="120">
      <template #default="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small"
          >查看</el-button
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { post, get, setItem, getItem, remItem, GetDataTest } from "../../utils/com";
import { defineComponent } from 'vue'
export default defineComponent({
  name: "Grop3",
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    handleClick(row) {
      console.log(row.id);
      alert("设备数值为："+row.attvalue)
    },
    users_getall() {
      const _this = this;
      var myget = get("http://127.0.0.1:8000/facility/all").then(function (res) {
        _this.tableData = res;
        return res;
      });
    },
  },
  mounted() {
    this.users_getall();
  },
});
</script>

<style scoped>
</style>